Skip to content

ci: remove cases.py, definitions.py, and case_validator.py from ALWAYS_RUN_ALL for smarter pruning#1328

Merged
sbryngelson merged 1 commit intoMFlowCode:masterfrom
sbryngelson:fix/smarter-always-run-all
Mar 19, 2026
Merged

ci: remove cases.py, definitions.py, and case_validator.py from ALWAYS_RUN_ALL for smarter pruning#1328
sbryngelson merged 1 commit intoMFlowCode:masterfrom
sbryngelson:fix/smarter-always-run-all

Conversation

@sbryngelson
Copy link
Copy Markdown
Member

Summary

Most physics PRs change cases.py (adding tests) and definitions.py (adding parameters). With both in ALWAYS_RUN_ALL, these PRs always run the full test suite, defeating the coverage-based pruning.

Neither file needs to trigger full runs:

  • cases.py: adding a test doesn't invalidate existing coverage data. New tests aren't in the cache → conservatively included (always run).
  • definitions.py: adding a parameter doesn't affect tests that don't use it. The PR's .fpp changes trigger the relevant tests via coverage overlap.

Files that remain in ALWAYS_RUN_ALL (changes here affect all test outputs):

  • CMakeLists.txt, GPU macro .fpp files, case.fpp
  • case.py, input.py, case_validator.py, coverage.py
  • toolchain/cmake/

Test plan

  • PR changing cases.py + .fpp files: pruning kicks in (not full suite)
  • New tests not in cache are still included conservatively

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

Claude Code Review

Head SHA: 54f11a6

Files changed:

  • 2
  • toolchain/mfc/test/coverage.py
  • toolchain/mfc/test/test_coverage_unit.py

Findings:

cases.py removal misses modifications to existing tests

The rationale ("new tests are conservatively included: not in cache → always runs") only covers the case where a brand-new test is added to cases.py. A test entry that already has a golden file has a stable UUID (CRC32 of its trace string). If an existing test's parameters are changed in cases.py without altering its trace string, the UUID stays the same, the golden file remains, and the coverage system has no .fpp signal to select that test — so the modified test never runs. A PR that changes only cases.py (modifying existing test parameters) would pass CI while exercising zero of the affected tests.

definitions.py removal misses changes to existing parameter defaults or constraints

The comment says "adding a parameter doesn't affect tests that don't use it", but definitions.py is also edited when default values, types, or constraint expressions are changed for existing parameters. Such changes can shift the generated .inp for every test that uses those parameters. With definitions.py removed from ALWAYS_RUN_ALL, a PR that only modifies a default value in definitions.py produces no .fpp coverage signal and runs no tests, leaving regressions undetected.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 914f26cb-affc-4b46-aeb9-82580174462a

📥 Commits

Reviewing files that changed from the base of the PR and between aa45305 and 54f11a6.

📒 Files selected for processing (2)
  • toolchain/mfc/test/coverage.py
  • toolchain/mfc/test/test_coverage_unit.py

📝 Walkthrough

Walkthrough

This change modifies the test invalidation logic by removing toolchain/mfc/test/cases.py and toolchain/mfc/params/definitions.py from the ALWAYS_RUN_ALL list in the coverage utility. The corresponding test cases are updated to reflect that changes to these files no longer unconditionally trigger full test suite execution. Instead, test coverage invalidation for these files is handled through coverage-based overlap and caching mechanisms. An end-to-end test exercised path is also updated from cases.py to case.py to verify the new behavior.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description provides a clear summary of changes and motivation. However, it is missing the required 'Fixes' issue reference, Type of change selection, and Testing details per the template. Add issue reference (Fixes #), select Type of change checkbox (likely Refactor), and document testing approach for the changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing two files from ALWAYS_RUN_ALL to enable smarter test pruning. It is specific, concise, and clearly conveys the primary objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sbryngelson sbryngelson merged commit 2162f7a into MFlowCode:master Mar 19, 2026
37 of 52 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.01%. Comparing base (2ffec9a) to head (54f11a6).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1328   +/-   ##
=======================================
  Coverage   45.01%   45.01%           
=======================================
  Files          70       70           
  Lines       20562    20562           
  Branches     1962     1962           
=======================================
  Hits         9255     9255           
  Misses      10179    10179           
  Partials     1128     1128           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbryngelson sbryngelson changed the title ci: remove cases.py and definitions.py from ALWAYS_RUN_ALL for smarter pruning ci: remove cases.py, definitions.py, and case_validator.py from ALWAYS_RUN_ALL for smarter pruning Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant